<%@ page contentType="text/html;charset=UTF-8"%>
<%@ include file="/common/taglibs.jsp"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta name="menu" content="assetMenu" />
<meta name="nav" content="1" />
<meta name="acc" content="0" />
<title>图书管理</title>
<script>
		$(document).ready(function() {
					$("#allowLend").click(function(){
						var booknames = new String("")  ;;
						var checkedBox = $("input:checked");
						var  books = new String("")  ;
						$.each(checkedBox, function(){
							  books+=$(this).val()+"_";	 	
							  booknames += $(this).attr("id")+";";
						});
						if(confirm("您将允许借出"+checkedBox.length+"本书？")){
							window.returnValue = {bookId:books,bookNames:booknames};
						}
						window.close();
					});
		});
			
	</script>
</head>
<body>
<form id="mainForm" action="bksn!list.action" method="get" class="yform">
<div id="filter">
<ul>
<li>图书类别:<pt:code  category="2023" name="filter_LIKES_bookinfo.bookType" prompt="全部" default="${param['filter_LIKES_bookinfo.bookType'] }"></pt:code>
</li>
<li>图书名称:<input type="text" name="filter_LIKES_bookinfo.bookName" value="${param['filter_LIKES_bookinfo.bookName']}" /></li>
<li>图书状态:
<pt:code category="2028" prompt="全部" name="filter_LIKES_status" default="${param['filter_LIKES_status']}"></pt:code></li>
</ul>
<div class="type-button"><input type="button" onclick="search();" class="search" value="查询"/></div>	
</div>
<div id="message"><s:actionmessage theme="custom"
	cssClass="success" /></div>
<div id="content">
<table id="contentTable">
	<tr>
		<th>选择</th>
		<th>图书类别</th>
		<th>图书名称</th>
		<th>图书编号</th>
		<th>状态</th>
	</tr>
	<c:forEach items="${page.result}" var="bksn" varStatus="var">
		<tr>
			<c:if test="${bksn.status=='1'}">
			<td>已借出</td>
			</c:if>
			<c:if test="${bksn.status!='1'}">
			<td><input type="checkbox" name="checkBook" value="${bksn.id}" id="${bksn.bookinfo.bookName}"></input></td>
			</c:if>
			<td>
			<c:if test="${ empty  bksn.bookinfo.bookType}">
				未分类
			</c:if>
			<c:if test="${not empty  bksn.bookinfo.bookType}">
				<pt:code category="2023" code="${bksn.bookinfo.bookType}"></pt:code>
			</c:if>
			</td>
			<td>${bksn.bookinfo.bookName}</td>
			<td>${bksn.bookSN}</td>
			<td>
				<c:if test="${bksn.status=='1'}">已借阅</c:if>
				<c:if test="${bksn.status!='1'}">未借阅</c:if>
			</td>
		</tr>
	</c:forEach>
	<tr>
		<td><input id="allowLend" type="button" value="允许借阅" /></td>
	</tr>
</table>
</div>
<jsp:include page="/common/page.jsp" />
</form>
</body>
</html>
